﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="http://dn-blqw.qbox.me/jq+bs+art.js" type="text/javascript"></script>
    <script src="js/jquery-form.js"></script>    
    <script src="js/underscore.js"></script>
    <script src="js/jquery-my-Extension.js"></script>
    <script src="js/kk.js" type="text/javascript"></script>
   
</head>
<body>
    <table class="table">
        <thead>
            <tr>
                <th>名称</th>
                <th>层级</th>
            </tr>
        </thead>
        <tbody>
            <tr style="display:none">
                <td>{F_CategoryName}</td>
                <td>{F_Lever}</td>
            </tr>
        </tbody>
    </table>
    <form id="form1">
        <input type="hidden" id="kid" name="kid" value="0"/>
        <input type="text" id="categoryName" name="categoryName" value="测试"/>
        <input type="text" id="parentKid" name="parentKid" value="0"/>
        <input type="button" onclick="f_SubmitSave()" value="提交保存" />
    </form>

    

    <script>

        function f_SubmitSave() {
            alert(JSON.stringify($("#form1").form("getData")));
            $("#form1").form("submit", {
                url: "http://192.168.1.175:1000/ProductsCategory/Save",
                onSubmit: function () {
                    return true;
                },
                success: function (res) {
                    alert(JSON.stringify(res));
                }
            })
        }

        //$(function () {
        //    f_GetData();
        //})

        function f_GetData() {
            kk.api.get("http://192.168.1.175:1000/ProductsCategory/GetList", function (data) {
                kk.fillTable(".table", data, function (data, name) {
                    if (name == "F_Lever") {
                        switch (data[name]) {
                            case 1:
                                return "<div>通过</div>";
                            case 2:
                                return "<div>未通过</div>";
                            case 3:
                                return "<div>未审核</div>"
                        }
                    }
                });
                kk.drawing();
            })
        }

    </script>
</body>
</html>
